article.guide(ng-controller="AdLibDataController")
  carousel.deck.container-fluid
    slide.row-fluid
      .col-sm-4
        h3 Query Template - Create
        p.lead Generate nodes and relationships
        form
          .node
            .form-group
              p.help-block From Node A
              label Label
              input.form-control(ng-model='nodeLabelA')
            .form-group
              .row
                .col-sm-6
                  label Property
                  input.form-control(ng-model='propertyKeyA')
                .col-sm-6
                  label Value
                  input.form-control(ng-model='propertyValueA')
          .relationship
            .form-group
              p.help-block through a Relationship
              label Type
              input(ng-model='relationshipType')
          .node
            .form-group
              p.help-block to Node B
              label Label
              input(ng-model='nodeLabelB')
            .form-group
              .row
                .col-sm-6
                  label Property
                  input.form-control(ng-model='propertyKeyB')
                .col-sm-6
                  label Value
                  input.form-control(ng-model='propertyValueB')

      .col-sm-8
        table.table.table-striped.table-bordered.table-fixed.th-100
          tr
            th Using Data
            td
              | From a node labeled &quot;{{nodeLabelA}}&quot;
              |  with a property called &quot;{{propertyKeyA}}&quot;
              |  which has value &quot;{{propertyValueA}}&quot;
              |  , through a relationship of type &quot;{{relationshipType}}&quot;
              |  to another node labeled &quot;{{nodeLabelB}}&quot;
              |  with a property called &quot;{{propertyKeyB}}&quot;
              |  which has value &quot;{{propertyValueB}}&quot;
          tr
            th Create
            td Create a &quot;{{nodeLabelA}}&quot; node
              |  with a property called &quot;{{propertyKeyA}}&quot;
              |  that has value &quot;{{propertyValueA}}&quot;. (Or create Node B)
              figure
                pre.code.runnable.standalone-example.
                  CREATE (n:{{nodeLabelA | tickitize}} { {{propertyKeyA | tickitize}}: '{{propertyValueA}}' }) RETURN n
              figure
                pre.code.runnable.standalone-example.
                  CREATE (n:{{nodeLabelB | tickitize}} { {{propertyKeyB | tickitize}}: '{{propertyValueB}}' }) RETURN n
          tr
            th Relate
            td From a &quot;{{nodeLabelA}}&quot; node
              |  with a &quot;{{propertyKeyA}}&quot; property
              |  of &quot;{{propertyValueA}}&quot;
              |  create a &quot;{{relationshipType}}&quot;
              |  relationship to a &quot;{{nodeLabelB}}&quot; with &quot;{{propertyKeyB}}&quot; value &quot;{{propertyValueB}}&quot;.
              |  Nodes 'a' and 'b' must already exist.
              figure
                pre.code.runnable.standalone-example.
                  MATCH (a:{{nodeLabelA | tickitize}} { {{propertyKeyA | tickitize}}: '{{propertyValueA}}' }), (b:{{nodeLabelB | tickitize}} { {{propertyKeyB | tickitize}}: '{{propertyValueB}}' })
                  CREATE (a)-[:{{relationshipType | tickitize}}]-&gt;(b)
          tr
            th Merge node
            td Find or create a &quot;{{nodeLabelA}}&quot; node
              |  with &quot;{{propertyKeyA}}&quot; of &quot;{{propertyValueA}}&quot;.
              figure
                pre.code.runnable.standalone-example.
                  MERGE (n:{{nodeLabelA | tickitize}} { {{propertyKeyA | tickitize}}: '{{propertyValueA}}' }) RETURN n
          tr
            th Merge relationship
            td Find or create a relationship from a &quot;{{nodeLabelA}} with &quot;{{propertyKeyA}}&quot; of &quot;{{propertyValueA}}&quot;
              |  through a &quot;{{relationshipType}}&quot; relationship
              |  to a &quot;{{nodeLabelB}}&quot; node with &quot;{{propertyKeyB}}&quot; of &quot;{{propertyValueB}}&quot;.
              figure
                pre.code.runnable.standalone-example.
                  MATCH (a:{{nodeLabelA | tickitize}} { {{propertyKeyA | tickitize}}: '{{propertyValueA}}' }), (b:{{nodeLabelB | tickitize}} { {{propertyKeyB | tickitize}}: '{{propertyValueB}}' })
                  MERGE (a)-[:{{relationshipType}}]-&gt;(b)
    slide.row-fluid
      .col-sm-4
        h3 Query Template - Find
        p.lead Find data using common graph patterns
        form
          .node
            .form-group
              p.help-block From Node A
              label Label
              input.form-control(ng-model='nodeLabelA')
            .form-group
              .row
                .col-sm-6
                  label Property
                  input.form-control(ng-model='propertyKeyA')
                .col-sm-6
                  label Value
                  input.form-control(ng-model='propertyValueA')
          .relationship
            .form-group
              p.help-block through a Relationship
              label Type
              input(ng-model='relationshipType')
          .node
            .form-group
              p.help-block to Node B
              label Label
              input(ng-model='nodeLabelB')
            .form-group
              .row
                .col-sm-6
                  label Property
                  input.form-control(ng-model='propertyKeyB')
                .col-sm-6
                  label Value
                  input.form-control(ng-model='propertyValueB')

      .col-sm-8
        table.table.table-striped.table-bordered.table-fixed.th-100
          tr
            th Using Data
            td
              | From a node labeled &quot;{{nodeLabelA}}&quot;
              |  with a property called &quot;{{propertyKeyA}}&quot;
              |  which has value &quot;{{propertyValueA}}&quot;
              |  , through a relationship of type &quot;{{relationshipType}}&quot;
              |  to another node labeled &quot;{{nodeLabelB}}&quot;
              |  with a property called &quot;{{propertyKeyB}}&quot;
              |  which has value &quot;{{propertyValueB}}&quot;
          tr
            th Find one
            td Find a node labeled &quot;{{nodeLabelA}}&quot;
              |  with a property called &quot;{{propertyKeyA}}&quot;
              |  that has value &quot;{{propertyValueA}}&quot;.
              figure
                pre.code.runnable.standalone-example.
                  MATCH (n:{{nodeLabelA | tickitize}} { {{propertyKeyA | tickitize}}: '{{propertyValueA}}' }) RETURN n
          tr
            th Find related neighbors
            td From a &quot;{{nodeLabelA}}&quot; node
              |  with a &quot;{{propertyKeyA}}&quot;
              |  of &quot;{{propertyValueA}}&quot;
              |  find neighbors related by &quot;{{relationshipType}}&quot;.
              figure
                pre.code.runnable.standalone-example.
                  MATCH (n:{{nodeLabelA| tickitize}} { {{propertyKeyA | tickitize}}: '{{propertyValueA}}' })-[:{{relationshipType | tickitize}}]-(neighbors) RETURN n,neighbors
          tr
            th Variable length paths
            td From a &quot;{{nodeLabelA}}&quot; node
              |  with a &quot;{{propertyKeyA}}&quot;
              |  of &quot;{{propertyValueA}}&quot;
              |  follow &quot;{{relationshipType}}&quot; relationships up to {{relationshipDepth}} hops away.
              figure
                pre.code.runnable.standalone-example.
                  MATCH (n:{{nodeLabelA}} { {{propertyKeyA | tickitize}}: '{{propertyValueA}}' })-[:{{relationshipType | tickitize}}*1..{{relationshipDepth}}]-(neighbors) RETURN n, collect(DISTINCT neighbors)
          tr
            th Shortest path
            td From a &quot;{{nodeLabelA}}&quot; node
              |  with a &quot;{{propertyKeyA}}&quot;
              |  of &quot;{{propertyValueA}}&quot;
              |  find the shortest &quot;{{relationshipType}}&quot; path to
              | a &quot;{{nodeLabelB}}&quot; node with &quot;{{propertyKeyB}}&quot; of &quot;{{propertyValueB}}&quot;
              figure
                pre.code.runnable.standalone-example.
                  MATCH p=shortestPath(
                    (a:{{nodeLabelA | tickitize}} { {{propertyKeyA | tickitize}}: '{{propertyValueA}}' })-[:{{relationshipType | tickitize}}]-(b:{{nodeLabelB | tickitize}} { {{propertyKeyB | tickitize}}: '{{propertyValueB}}'})
                  )
                  RETURN p

    slide.row-fluid.header
      .col-sm-4
        h3 Next steps
      .col-sm-4
        h3 More code
        ul.undecorated
          li
            a(play-topic='northwind-graph') Northwind Graph
            |  - from RDBMS to graph
          li
            a(play-topic='movie-graph') Movie Graph
            |  - common ad-hoc queries
          li
            a(play-topic='cypher') Cypher
            |  - query language fundamentals
      .col-sm-4
        h3 Reference
        ul.undecorated
          li
            a(href='http://neo4j.com/developer') Developer resources
          li
            a(href='{{ neo4j.version | neo4jDeveloperDoc }}/') Neo4j Developer Manual
